package com.xilin.kotlincoroutine

import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking

fun main() = runBlocking {
    val job = launch(start = CoroutineStart.ATOMIC) {
        println("hello job1")
        delay(5000)
        println("job finished")
    }
    job.cancel()
}